#pragma once
#include <QDomDocument>
#include <QDomElement>
#include <QDomAttr>
#include <QDomText>
#include <QFile>
#include <QString>
#include <QStringList>
#include <QLatin1String>
#include <QTextStream>
#include <QFileInfo>
#include <QDir>
#include <qdatetime.h>
#include <qdebug.h>
class CXmlRW
{
public:
    CXmlRW(void);
    CXmlRW(const char *filename);
    virtual ~CXmlRW(void);
    void GetParentNode();
    void GetChildNode();
    void GetSblingNode();
    QDomNode GetCurrentNode();

    void setRoot(QString RootElementName, QStringList ElementAttrList,
                 QStringList AttrValueList);
    void AddChildNode(QString tagName, QStringList ElementAttrList,
                      QStringList AttrValueList);
    void Save();
    void SetWriteXml(bool iswrite=false);
private:
    QFile *m_file;
    QDomDocument *m_DomDoccument;
    QDomNode m_CurrentNode;
    QDomElement Root;
    bool m_IsWrite;
    bool CreateXMl(const char* filename);
};
